import React, { useState, useEffect } from 'react'
import store from './redux/store'
import Count from './components/Count'
export default function App() {
  const [c, setC] = useState(0)
  useEffect(() => {
    // app组件挂载的时候,监听redux数据变化,一旦redux数据变化,让app更新,则下面所有的组件都更新.就可以展示最新的redux数据
    store.subscribe(() => {
      setC((c) => {
        return c + 1
      })
    })
  }, [])
  return (
    <div>
      App
      <hr />
      <Count></Count>
    </div>
  )
}
